package ThreadPool.chapter2;

import java.util.concurrent.TimeUnit;

/**
 * @param
 * @author oyz
 * @version 1.0.4
 * @description:TODO
 * @date 2022/12/20 21:07
 */
public class SynchronizedMethod2 extends Guard{
    @Override
    public void method() {
        try{
            TimeUnit.MILLISECONDS.sleep(10);
        }catch (InterruptedException e){
            e.printStackTrace();
        }
        synchronized (this){
            callCount.incrementAndGet();
        }
    }
}
